package org.openmore.consumer.service.feignImpl;

import feign.hystrix.FallbackFactory;
import org.openmore.consumer.dto.common.BaseResponse;
import org.openmore.consumer.service.feign.DictionaryService;
import org.openmore.consumer.dto.common.DictionaryDto;
import org.springframework.stereotype.Component;

@Component
public class DictionaryServiceImpl extends BaseFeignFallback implements FallbackFactory<DictionaryService> {
    @Override
    public DictionaryService create(Throwable cause) {
        return new DictionaryService() {
            @Override
            public BaseResponse selectMenuByPage(String type, String name, Integer pageNum, Integer pageSize) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse selectAllByPage(String type, String name, Integer pageNum, Integer pageSize) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse selectTreeByParentKey(String parentKey) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse selectAllByParentKeyPage(String parentKey, String typeLevel, String name, String sort, Integer pageNum, Integer pageSize) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse getDictionaryById(String id) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse updateDictionary(DictionaryDto dictionary) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse insertDictionary(DictionaryDto dictionary) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse deleteDictionary(String id) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse getChildrenByParentKey2(String parentKey, Boolean cache) {
                return getFallBackResponse();
            }
        };
    }
}
